﻿/*
 * (c) 2011 MOSA - The Managed Operating System Alliance
 *
 * Licensed under the terms of the New BSD License.
 *
 * Authors:
 *  Phil Garcia (tgiphil) <phil@thinkedge.com> 
 *
 */

using MbUnit.Framework;
using iPear.Test.Collection;
using iPear.Test.System;
using iPear.Test.System.Numbers;

namespace iPear.Test.Cases.IL
{
	[TestFixture]
	public class Switch : TestCompilerAdapter
	{
		public Switch()
		{
			settings.AddReference("iPear.Test.Collection.dll");
		}
		
		[Test]
		public void SwitchU1([U1]byte a)
		{
			Assert.AreEqual(SwitchTests.SwitchU1(a), Run<byte>("iPear.Test.Collection", "SwitchTests", "SwitchU1", a));
		}
		
		[Test]
		public void SwitchU2([U2]ushort a)
		{
			Assert.AreEqual(SwitchTests.SwitchU2(a), Run<ushort>("iPear.Test.Collection", "SwitchTests", "SwitchU2", a));
		}
		
		[Test]
		public void SwitchU4([U4]uint a)
		{
			Assert.AreEqual(SwitchTests.SwitchU4(a), Run<uint>("iPear.Test.Collection", "SwitchTests", "SwitchU4", a));
		}
		
		[Test]
		public void SwitchU8([U8]ulong a)
		{
			Assert.AreEqual(SwitchTests.SwitchU8(a), Run<ulong>("iPear.Test.Collection", "SwitchTests", "SwitchU8", a));
		}
		
		[Test]
		public void SwitchI1([I1]sbyte a)
		{
			Assert.AreEqual(SwitchTests.SwitchI1(a), Run<sbyte>("iPear.Test.Collection", "SwitchTests", "SwitchI1", a));
		}
		
		[Test]
		public void SwitchI2([I2]short a)
		{
			Assert.AreEqual(SwitchTests.SwitchI2(a), Run<short>("iPear.Test.Collection", "SwitchTests", "SwitchI2", a));
		}
		
		[Test]
		public void SwitchI4([I4]int a)
		{
			Assert.AreEqual(SwitchTests.SwitchI4(a), Run<int>("iPear.Test.Collection", "SwitchTests", "SwitchI4", a));
		}
		
		[Test]
		public void SwitchI8([I8]long a)
		{
			Assert.AreEqual(SwitchTests.SwitchI8(a), Run<long>("iPear.Test.Collection", "SwitchTests", "SwitchI8", a));
		}
		
	}
}
